package zuoye;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangshuai
 * @version V1.0
 * @Project Java2_26
 * @Package zuoye
 * @Description:
 * @Date 2025/5/16 11:06
 */

public class Demo3 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>(2);//初始容量为2
        list.add("A");
        list.add("B");
        String remove = list.remove(0);
        System.out.println("remove:"+remove);
        list.add(remove);
        System.out.println(list.get(1));
    }
}